package com.easylinkin.linkappapi.hcmy.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.LinkedHashMap;
import java.util.List;

@Data
@NoArgsConstructor
@TableName(value = "hcmy_areasourceecology_function")
public class AreasourceecologyFunction {
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 年度
     */
    @TableField(value = "year")
    private Integer year;

    /**
     * 区域ids
     */
    @TableField(value = "area_ids")
    private String areaIds;

    /**
     * 租户id
     */
    @TableField(value = "tenant_id")
    private String tenantId;

    /**
     * 创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 创建人id
     */
    @TableField(value = "creator")
    private String creator;

    /**
     * 修改人id
     */
    @TableField(value = "modifier")
    private String modifier;

    /***
     * 功能菜单类型
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 修改时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "modify_time")
    private LocalDateTime modifyTime;

    @TableField(exist = false)
    private LinkedHashMap<String,@Digits(integer = 8, fraction=3, message = "请输入8位整数和3位小数范围内")@DecimalMin(value = "0.000", message = "请输入大于0的数") BigDecimal> dataMap;

    @TableField(exist = false)
    private List<Integer> ids;

    /***
     * 区
     */
    @TableField(exist = false)
    private String areaPath;

    @TableField(exist = false)
    private String fatherAreaPath;

    @TableField(exist = false)
    private String sonAreaPath;

    @TableField(exist = false)
    private String spaceIds;
}